<div class="surveys index">
	<div class="page-header">
		<h1 style="display: inline;">
			My Surveys
			<small><?php echo $this->Paginator->counter(array('format' => __('(Page {:page} of {:pages})'))); ?></small>
		</h1>
		<div class="pull-right">
			<?php echo $this->TwitterBootstrap->button_link("<i class='icon-plus icon-white'></i>&nbsp;Create a Survey", array('controller' => 'Surveys', 'action' => 'add'), array('style' => 'success', 'escape' => false)); ?>
		</div>
	</div>
	<?php if (!empty($surveys)): ?>
		<table cellpadding="0" cellspacing="0" class="table table-hover">
			<tr>
					<th><?php echo $this->Paginator->sort('name'); ?></th>
					<th><?php echo $this->Paginator->sort('created'); ?></th>
					<th><?php echo $this->Paginator->sort('closes'); ?></th>
			</tr>
			<?php foreach ($surveys as $survey): ?>
				<tr>
					<td><?php echo $this->Html->link($survey['Survey']['name'], array('controller' => "surveys", 'action' => 'view', $survey['Survey']['id'])); ?>&nbsp;</td>
					<td><?php echo $this->Time->timeAgoInWords($survey['Survey']['created']); ?>&nbsp;</td>
					<td><?php echo $this->Time->nice($survey['Survey']['closes']); ?>&nbsp;</td>
				</tr>
			<?php endforeach; ?>
		</table>

		<ul class="pager">
		  <?php echo $this->Paginator->prev("&larr; Previous", array('escape' => false, 'tag' => 'li', 'class' => 'previous'), null, array('escape' => false, 'tag' => 'li', 'disabledTag' => 'a', 'class' => 'previous disabled')); ?>
		  <?php echo $this->Paginator->next("Next &rarr;", array('escape' => false, 'tag' => 'li', 'class' => 'next'), null, array('escape' => false, 'tag' => 'li', 'disabledTag' => 'a', 'class' => 'next disabled')); ?>
		  
		</ul>
	<?php else: ?>
		<p>
			You haven't created any surveys yet.
		</p>
	<?php endif; ?>
</div>
